import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import*
from selenium.webdriver.support.select import  Select
testCase19='DBshop019_添加属性组流程'
firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu3(firefox,'商品管理','商品属性','属性')#进入属性
firefox.find_element_by_partial_link_text('添加属性').click()
s1=firefox.find_element_by_id("attribute_group_id")
Select(s1).select_by_visible_text('好好学习')# 选择好好学习
s2=firefox.find_element_by_id("attribute_type") #进入下拉款2
Select(s2).select_by_visible_text('下拉')# 选择下拉
firefox.find_element_by_id('attribute_name').send_keys('天天向上')
firefox.find_element_by_id('attribute_sort').clear()
firefox.find_element_by_id('attribute_sort').send_keys('255')#排序选择255
firefox.find_element_by_xpath('//button').click() #保存属性信息
time.sleep(3)
try:
    firefox.find_element_by_xpath('//td[text()="天天向上"]')
    writeLog('%s 测试通过'%testCase19)
except:
    writeLog('%s 测试不通过' % testCase19)
    getPhoto(firefox)
firefox.quit()



